home *** CD-ROM | disk | FTP | other *** search
- Subject: supplementary groups question...
- Date: Thu, 23 Jun 94 9:59:34 +0200
- From: Torsten Scherer <itschere@techfak.uni-bielefeld.de>
-
- Again: Hi! :-)
-
- I now want to finish what I've partly started some weeks before and what
- has already gone into the mh3 meta patch: The story of the supplementary
- groups. Now, before I run into problems again because I implement things
- the way I would like them and not the way the rest of the world understands
- them, I like to ask to be sure first... ;-)
-
- My current understanding is that a process inherits its supplementary
- groups from its parent. Apart from that, only the superuser is allowed to
- change them, say, `login' should do that together with a library function
- `initgroups'. The rest would simply be to fix the denyaccess() function
- in filesys.c to respect the supplementary groups. There's explicitly *no*
- need for a program to set the egid to any of its suppgids when it wants
- to access something. Everything necessary is done in the kernel. Right? :-)
-
- Besides that: The current code of denyaccess() says something like:
-
- mode = xattr->mode;
- if (curproc->euid == xattr->uid)
- perm = perm << 6;
- else if (curproc->egid == xattr->gid)
- perm = perm << 3;
- if ((mode & perm) != perm) return 1; /* access denied */
- return 0;
-
- which I think is an error, because if both my euid and egid would match the
- ids of the file, but the uid would give me less access rights than the gid
- for some mysterious reasons, I'll not be granted access to this file. I think
- it should better be something like:
-
- mode = xattr->mode;
- if (curproc->euid == xattr->uid) {
- if ((mode >> 6) & perm) == perm)
- return 0;
- }
- if (curproc->guid == xattr->gid) {
- if ((mode >> 3) & perm) == perm)
- return 0;
- }
- if ((mode & perm) == perm)
- return 0; /* access denied */
- return 1;
-
- One could yet complicate this thing by saying: If the file would look like
- r---w---x and all my effective ids match the ones given in the file I should
- also given access to it, but I guess no other OS really implements this, does
- it? ;-)
-
- Any comments about this? :-)
-
- ciao,
- TeSche
- --
- Torsten Scherer (TeSche, Schiller...)
- Faculty of Technology, University of Bielefeld, Germany, Europe, Earth...
- | Use any of "finger itschere@129.70.131.2-15" for adresses and more. |
- | Last updated: 14. April 1994. |
-